package org.example.AI;


/**
 * @author: 默苍璃
 * @date: 2024-07-18 10:50
 */
// 非终结符表达式：减法表达式
public class SubtractExpression implements Expression {
    private Expression left;
    private Expression right;

    public SubtractExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret(Context context) {
        return left.interpret(context) - right.interpret(context);
    }
}
